<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>网上订餐系统</title>
    <meta name="keywords" content="DeathGhost,DeathGhost.cn,web前端设,移动WebApp开发"/>
    <meta name="description" content="DeathGhost.cn::H5 WEB前端设计开发!"/>
    <meta name="author" content="DeathGhost"/>
    <link th:href="@{/style/style.css}" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" th:src="@{/js/public.js}"></script>
    <script type="text/javascript" th:src="@{/js/jquery.js}"></script>
    <script type="text/javascript" th:src="@{/js/jqpublic.js}"></script>
    <script th:inline="javascript">
        window.onload = function() {
            var mm = [[${mm}]];
            if(mm != null){
                alert("修改成功")
            }
        }
        function checkForm() {
            var meal_price = $("#meal_price").val();
            if (!Number(meal_price)) {
                alert("价格必须为数字！");
                return false;
            }
            var meal_price_now = $("#meal_price_now").val();
            if (!Number(meal_price_now)) {
                alert("价格必须为数字！");
                return false;
            }
            $("#updateProductForm").submit();
        }
    </script>
</head>
<body>
<!--引用头部导航栏代码块-->
<div th:replace="~{commons/common::top1}"></div>
<!--Start content-->
<section class="Psection MT20">
    <article class="U-article Overflow">
        <!--user Account-->
        <section class="AccManage Overflow">
            <span class="AMTitle Block Font14 FontW Lineheight35">账户管理</span>
            <form th:action="@{/admin/updateMealInformation}" method="post" enctype="multipart/form-data" id="updateProductForm">
                <table>
                    <input type="hidden" name="meal_id" id="meal_id" th:value="${meal.meal_id}">
                    <tr>
                        <td width="30%" align="right">图片：</td>
                        <td><input type="file" name="file" id="file" th:value="${meal.meal_name}"></td>
                    </tr>
                    <tr>
                        <td width="30%" align="right" style="color: darkred">*菜名：</td>
                        <td><input type="text" name="meal_name" th:value="${meal.meal_name}" required></td>
                    </tr>
                    <tr>
                        <td width="30%" align="right">描述：</td>
                        <td><input type="text" name="meal_description" th:value="${meal.meal_description}"></td>
                    </tr>
                    <tr>
                        <td width="30%" align="right" style="color: darkred">*原价：</td>
                        <td><input type="text" name="meal_price" id="meal_price" required th:value="${meal.meal_price}"></td>
                    </tr>
                    <tr>
                        <td width="30%" align="right" style="color: darkred">*现价：</td>
                        <td><input type="text" name="meal_price_now" id="meal_price_now" th:value="${meal.meal_price_now}" required></td>
                    </tr>
                    <tr>
                        <td width="30%" align="right" style="color: darkred">类别</td>
                        <td>
                        <select id="meal_classification" name="meal_classification" required class="form-control" style="width:170px;height:26px;margin:6px;border-color: #3d3d3d;border-radius: 10px">
                            <option selected th:value="${meal.meal_classification}">[[${meal.meal_classification}]]</option>
                            <option th:if="${meal.meal_classification ne '荤菜'}" value="荤菜">荤菜</option>
                            <option th:if="${meal.meal_classification ne '素菜'}" value="素菜">素菜</option>
                            <option th:if="${meal.meal_classification ne '主食'}" value="主食">主食</option>
                            <option th:if="${meal.meal_classification ne '饮品'}" value="饮品">饮品</option>
                        </select>
                        </td>
                    </tr>
                    <tr>
                        <td></td>
                        <td><input name="" type="button" onclick="checkForm()" value="保 存"></td>
                    </tr>
                </table>
            </form>
        </section>
    </article>
</section>
<!--End content-->
<!--引用底部栏代码块-->
<div th:replace="~{commons/common::last}"></div>
</body>
</html>
